package com.zzyl.mapper;

import com.zzyl.entity.live.Bed;
import com.zzyl.vo.BedVo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface BedMapper {
	
	List<BedVo> getBedsByRoomId(Long roomId);
	
	/**
	 * 新增
	 * @param bed
	 * @return
	 */
	int insert(Bed bed);
	
	/**
	 * 根据主键查询
	 * @param id
	 * @return
	 */
	Bed selectById(Long id);
	
	/**
	 * 修改床位
	 * @param bed
	 * @return
	 */
	int updateBy(Bed bed);
	
	/**
	 * 根据主键删除床位
	 * @param id
	 * @return
	 */
	int deleteById(Long id);

    void saveOrUpdate(Bed bed);

	@Select("select * from zzyl.live_bed where id = #{id}")
	BedVo readAllBed(Integer id);

	void updateBed(BedVo bedVo);
@Delete("delete from zzyl.live_bed  where id = #{id}")
	void deleteBed(Integer id);
}

